<?php

namespace Home\Controller;

use Think\Controller;



class ReturnController extends Controller{

    public function index($ipaddr){

            if (!empty($ipaddr)) {
                header('Access-Control-Allow-Origin: *');
                header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
                header('Access-Control-Allow-Methods: GET, POST, PUT');

                $Ipaddress = M("Ipaddress"); // 实例化User对象
                $data['ipaddr'] = $ipaddr;

                $result = $Ipaddress->where($data)->find();

                if (empty($result)) {
                    echo 'false';
                } else {

                    $Ipaddress->where(array('id'=>$result['id']))->delete();
                    //$Ipaddress->where(array('id'=>$result['id']))->setDec('tid',1);
                    
                    echo 'true';
                }
            } else {
                echo '';
            }
            
            
    }

}